<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ATM-模拟</title>
    <script src="sdk/jquery-1.10.min.js"></script>
    <style>
        body, html {
            margin: 0;
            height: 100%;
        }

        .content {
            color: white;
            font-weight: bold;
            font-size: 25px;
            margin: 0 auto;
            margin-top: 250px;
            width: max-content;
        }

        button {
            height: 85px;
            width: 200px;
            background-color: #d7d7d7;
            font-size: 20px;
            font-weight: bold;
            border: 0;
        }
    </style>
</head>
<body>
    <div style="margin: 0 auto;overflow: hidden;height: 15%;">
        <div style="float: left;margin: 10px;">
            <img src="img/信工logo.jfif" width="100px" alt="信工logo">
        </div>
        <div style="float: left;margin-left: 10px;">
            <span style="font-size: 50px;font-weight: bold;">中国儿童银行</span>
            <br>
            <span style="font-size: 35px;font-weight: bold;">China Child Bank</span>
        </div>
    </div>


    <div style="background-color: #330099;overflow: hidden;height: 85%;">
        <div style="float: left;width: 15%;">
            <button style="margin-top: 100px;border-bottom-right-radius: 10px;border-top-right-radius: 10px;box-shadow: 1px 1px 5px black;"
                    onclick="cashLog()">取款记录 <br> Cash Records
            </button>
            <br>
            <button style="margin-top: 120px;border-bottom-right-radius: 10px;border-top-right-radius: 10px;box-shadow: 1px 1px 5px black;"
                    onclick="transferLog()">转账记录 <br> Transfer Records
            </button>

        </div>
        <div style="float: left;width: 70%;">
            <div class="content">
                <h1 style="color: white;">请选择记录类型</h1>
            </div>
        </div>
        <div style="float:right;width: 15%;">
            <button style="margin-top: 100px;border-bottom-left-radius: 10px;border-top-left-radius: 10px;box-shadow: -1px 1px 5px black;float: right;"
                    onclick="depositLog()">存款记录 <br> Deposit Records
            </button>
            <br>
            <button style="margin-top: 520px;border-bottom-left-radius: 10px;border-top-left-radius: 10px;box-shadow: -1px 1px 5px black;float: right;"
                    onclick="backToIndex()">返回 <br> Back
            </button>
        </div>
    </div>


    <script>

        $(function () {
            $.ajax(
                {
                    url: "http://localhost:8888/atm/api/checkToken?token=" + localStorage.getItem("token"),
                    type: "POST",
                    datatype: "json",
                    success: function (res) {
                        if (res.code === 10001){
                            alert("登录异常，请重新登录")
                            window.location="./login.html"
                        }
                    },
                    error: function (){
                        alert("服务器异常！")
                    }
                }
            )
            }
        )

        function cashLog() {
            window.location = "./log.html?type=cashLog&page=0"
        }

        function depositLog() {
            window.location = "./log.html?type=depositLog&page=0"
        }

        function transferLog() {
            window.location = "./log.html?type=transferLog&page=0"
        }

        function backToIndex() {
            window.location = "./index.html"
        }
    </script>
</body>
</html>